using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;

namespace UIProcessActivities
{
    [Designer(typeof(FindFormResourceValueDesigner), typeof(IDesigner))]
    public partial class FindFormResourceValue : SequenceActivity
    {
        public FindFormResourceValue()
        {
            InitializeComponent();
        }

        public static DependencyProperty FormProperty = System.Workflow.ComponentModel.DependencyProperty.Register("Form", typeof(UIProcessSchemaObjects.Form), typeof(FindFormResourceValue));

        [Description("The Form you want to get a FormResource Value from")]
        [Category("Input")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public UIProcessSchemaObjects.Form Form
        {
            get
            {
                return ((UIProcessSchemaObjects.Form)(base.GetValue(FindFormResourceValue.FormProperty)));
            }
            set
            {
                base.SetValue(FindFormResourceValue.FormProperty, value);
            }
        }

        public static DependencyProperty FormResourceNameProperty = System.Workflow.ComponentModel.DependencyProperty.Register("FormResourceName", typeof(string), typeof(FindFormResourceValue));

        [Description("Name of the Form Resource to get the value from")]
        [Category("Input")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public string FormResourceName
        {
            get
            {
                return ((string)(base.GetValue(FindFormResourceValue.FormResourceNameProperty)));
            }
            set
            {
                base.SetValue(FindFormResourceValue.FormResourceNameProperty, value);
            }
        }

        public static DependencyProperty FieldNameProperty = System.Workflow.ComponentModel.DependencyProperty.Register("FieldName", typeof(string), typeof(FindFormResourceValue));

        [Description("The Name of the Field to get the value from")]
        [Category("Input")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public string FieldName
        {
            get
            {
                return ((string)(base.GetValue(FindFormResourceValue.FieldNameProperty)));
            }
            set
            {
                base.SetValue(FindFormResourceValue.FieldNameProperty, value);
            }
        }

        public static DependencyProperty FieldValueProperty = System.Workflow.ComponentModel.DependencyProperty.Register("FieldValue", typeof(string), typeof(FindFormResourceValue));

        [Description("The value returned from the field")]
        [Category("Return")]
        [Browsable(true)]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
        public string FieldValue
        {
            get
            {
                return ((string)(base.GetValue(FindFormResourceValue.FieldValueProperty)));
            }
            set
            {
                base.SetValue(FindFormResourceValue.FieldValueProperty, value);
            }
        }

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            UIProcessSchemaObjects.FormResource _theResource = null;

            foreach (UIProcessSchemaObjects.FormResource objTemp in this.Form.FormResources)
            {
                if (objTemp.Name == this.FormResourceName)
                {
                    _theResource = objTemp;
                    break;
                }
            }

            if (_theResource is UIProcessSchemaObjects.AddressEntryNA)
            {
                UIProcessSchemaObjects.AddressEntryNA _theEntry = (UIProcessSchemaObjects.AddressEntryNA)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Address1":
                        this.FieldValue = _theEntry.Address1;
                        break;
                    case "Address2":
                        this.FieldValue = _theEntry.Address2;
                        break;
                    case "City":
                        this.FieldValue = _theEntry.City;
                        break;
                    case "State":
                        this.FieldValue = _theEntry.State;
                        break;
                    case "PostalCode":
                        this.FieldValue = _theEntry.PostalCode;
                        break;
                    case "CountryCode":
                        this.FieldValue = _theEntry.CountryCode;
                        break;
                    case "NotApplicable":
                        this.FieldValue = _theEntry.NotApplicable.ToString();
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.AddressEntry)
            {
                UIProcessSchemaObjects.AddressEntry _theEntry = (UIProcessSchemaObjects.AddressEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Address1":
                        this.FieldValue = _theEntry.Address1;
                        break;
                    case "Address2":
                        this.FieldValue = _theEntry.Address2;
                        break;
                    case "City":
                        this.FieldValue = _theEntry.City;
                        break;
                    case "State":
                        this.FieldValue = _theEntry.State;
                        break;
                    case "PostalCode":
                        this.FieldValue = _theEntry.PostalCode;
                        break;
                    case "CountryCode":
                        this.FieldValue = _theEntry.CountryCode;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.Conditional)
            {
                UIProcessSchemaObjects.Conditional _theEntry = (UIProcessSchemaObjects.Conditional)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Expression":
                        this.FieldValue = _theEntry.Expression;
                        break;
                    case "JumpToFormResource":
                        this.FieldValue = _theEntry.JumpToFormResource;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.DataField)
            {
                UIProcessSchemaObjects.DataField _theEntry = (UIProcessSchemaObjects.DataField)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "FieldValue":
                        this.FieldValue = _theEntry.FieldValue;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.DateTimeEntryNA)
            {
                UIProcessSchemaObjects.DateTimeEntryNA _theEntry = (UIProcessSchemaObjects.DateTimeEntryNA)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Date":
                        this.FieldValue = _theEntry.Date;
                        break;
                    case "Time":
                        this.FieldValue = _theEntry.Time;
                        break;
                    case "NotApplicable":
                        this.FieldValue = _theEntry.NotApplicable.ToString();
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.DateTimeEntry)
            {
                UIProcessSchemaObjects.DateTimeEntry _theEntry = (UIProcessSchemaObjects.DateTimeEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Date":
                        this.FieldValue = _theEntry.Date;
                        break;
                    case "Time":
                        this.FieldValue = _theEntry.Time;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.DateEntryNA)
            {
                UIProcessSchemaObjects.DateEntryNA _theEntry = (UIProcessSchemaObjects.DateEntryNA)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Date":
                        this.FieldValue = _theEntry.Date;
                        break;
                    case "NotApplicable":
                        this.FieldValue = _theEntry.NotApplicable.ToString();
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.DateEntry)
            {
                UIProcessSchemaObjects.DateEntry _theEntry = (UIProcessSchemaObjects.DateEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Date":
                        this.FieldValue = _theEntry.Date;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.GraphicAnnotation)
            {
                UIProcessSchemaObjects.GraphicAnnotation _theEntry = (UIProcessSchemaObjects.GraphicAnnotation)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "FullScreen":
                        this.FieldValue = _theEntry.FullScreen.ToString();
                        break;
                    case "DisplayMode":
                        this.FieldValue = _theEntry.DisplayMode.ToString();
                        break;
                    case "ImageBytes":
                        this.FieldValue = _theEntry.ImageBytes;
                        break;
                    case "AnnotationBytes":
                        this.FieldValue = _theEntry.AnnotationBytes;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.GraphicDisplay)
            {
                UIProcessSchemaObjects.GraphicDisplay _theEntry = (UIProcessSchemaObjects.GraphicDisplay)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "FullScreen":
                        this.FieldValue = _theEntry.FullScreen.ToString();
                        break;
                    case "DisplayMode":
                        this.FieldValue = _theEntry.DisplayMode.ToString();
                        break;
                    case "ImageBytes":
                        this.FieldValue = _theEntry.ImageBytes;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.MultiSelectOtherEntry)
            {
                UIProcessSchemaObjects.MultiSelectOtherEntry _theEntry = (UIProcessSchemaObjects.MultiSelectOtherEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Options":
                        foreach (string strTemp in _theEntry.Options)
                        {
                            this.FieldValue += strTemp;
                            this.FieldValue += ":";
                        }
                        break;
                    case "Selections":
                        foreach (string strTemp in _theEntry.Selections)
                        {
                            this.FieldValue += strTemp;
                            this.FieldValue += ":";
                        }
                        break;
                    case "OtherSelected":
                        this.FieldValue = _theEntry.OtherSelected.ToString();
                        break;
                    case "OtherValue":
                        this.FieldValue = _theEntry.OtherValue;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.MultiSelectEntry)
            {
                UIProcessSchemaObjects.MultiSelectEntry _theEntry = (UIProcessSchemaObjects.MultiSelectEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Options":
                        foreach (string strTemp in _theEntry.Options)
                        {
                            this.FieldValue += strTemp;
                            this.FieldValue += ":";
                        }
                        break;
                    case "Selections":
                        foreach (string strTemp in _theEntry.Selections)
                        {
                            this.FieldValue += strTemp;
                            this.FieldValue += ":";
                        }
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.NameEntry)
            {
                UIProcessSchemaObjects.NameEntry _theEntry = (UIProcessSchemaObjects.NameEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "NameTitle":
                        this.FieldValue = _theEntry.NameTitle;
                        break;
                    case "Given":
                        this.FieldValue = _theEntry.Given;
                        break;
                    case "Middle":
                        this.FieldValue = _theEntry.Middle;
                        break;
                    case "Family":
                        this.FieldValue = _theEntry.Family;
                        break;
                    case "Suffix":
                        this.FieldValue = _theEntry.Suffix;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.NoteEntry)
            {
                UIProcessSchemaObjects.NoteEntry _theEntry = (UIProcessSchemaObjects.NoteEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "NoteText":
                        this.FieldValue = _theEntry.NoteText;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.NumberEntryNA)
            {
                UIProcessSchemaObjects.NumberEntryNA _theEntry = (UIProcessSchemaObjects.NumberEntryNA)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "NumberValue":
                        this.FieldValue = _theEntry.NumberValue;
                        break;
                    case "NotApplicable":
                        this.FieldValue = _theEntry.NotApplicable.ToString();
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.NumberEntry)
            {
                UIProcessSchemaObjects.NumberEntry _theEntry = (UIProcessSchemaObjects.NumberEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "NumberValue":
                        this.FieldValue = _theEntry.NumberValue;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.PasswordEntry)
            {
                UIProcessSchemaObjects.PasswordEntry _theEntry = (UIProcessSchemaObjects.PasswordEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Password":
                        this.FieldValue = _theEntry.Password;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.PhoneEntryNA)
            {
                UIProcessSchemaObjects.PhoneEntryNA _theEntry = (UIProcessSchemaObjects.PhoneEntryNA)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "NationalCode":
                        this.FieldValue = _theEntry.NationalCode;
                        break;
                    case "CountryCode":
                        this.FieldValue = _theEntry.CountryCode;
                        break;
                    case "AreaCode":
                        this.FieldValue = _theEntry.AreaCode;
                        break;
                    case "Number":
                        this.FieldValue = _theEntry.Number;
                        break;
                    case "Extension":
                        this.FieldValue = _theEntry.Extension;
                        break;
                    case "Pin":
                        this.FieldValue = _theEntry.Pin;
                        break;
                    case "NotApplicable":
                        this.FieldValue = _theEntry.NotApplicable.ToString();
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.PhoneEntry)
            {
                UIProcessSchemaObjects.PhoneEntry _theEntry = (UIProcessSchemaObjects.PhoneEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "NationalCode":
                        this.FieldValue = _theEntry.NationalCode;
                        break;
                    case "CountryCode":
                        this.FieldValue = _theEntry.CountryCode;
                        break;
                    case "AreaCode":
                        this.FieldValue = _theEntry.AreaCode;
                        break;
                    case "Number":
                        this.FieldValue = _theEntry.Number;
                        break;
                    case "Extension":
                        this.FieldValue = _theEntry.Extension;
                        break;
                    case "Pin":
                        this.FieldValue = _theEntry.Pin;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.PostalCodeEntryNA)
            {
                UIProcessSchemaObjects.PostalCodeEntryNA _theEntry = (UIProcessSchemaObjects.PostalCodeEntryNA)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "PostalCode":
                        this.FieldValue = _theEntry.PostalCode;
                        break;
                    case "NotApplicable":
                        this.FieldValue = _theEntry.NotApplicable.ToString();
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.PostalCodeEntry)
            {
                UIProcessSchemaObjects.PostalCodeEntry _theEntry = (UIProcessSchemaObjects.PostalCodeEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "PostalCode":
                        this.FieldValue = _theEntry.PostalCode;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.SignatureCaptureEntry)
            {
                UIProcessSchemaObjects.SignatureCaptureEntry _theEntry = (UIProcessSchemaObjects.SignatureCaptureEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "SignatureBytes":
                        this.FieldValue = _theEntry.SignatureBytes;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.SingleSelectOtherEntry)
            {
                UIProcessSchemaObjects.SingleSelectOtherEntry _theEntry = (UIProcessSchemaObjects.SingleSelectOtherEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Options":
                        foreach (string strTemp in _theEntry.Options)
                        {
                            this.FieldValue += strTemp;
                            this.FieldValue += ":";
                        }
                        break;
                    case "Selections":
                        foreach (string strTemp in _theEntry.Selections)
                        {
                            this.FieldValue += strTemp;
                            this.FieldValue += ":";
                        }
                        break;
                    case "OtherSelected":
                        this.FieldValue = _theEntry.OtherSelected.ToString();
                        break;
                    case "OtherValue":
                        this.FieldValue = _theEntry.OtherValue;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.SingleSelectEntry)
            {
                UIProcessSchemaObjects.SingleSelectEntry _theEntry = (UIProcessSchemaObjects.SingleSelectEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Options":
                        foreach (string strTemp in _theEntry.Options)
                        {
                            this.FieldValue += strTemp;
                            this.FieldValue += ":";
                        }
                        break;
                    case "Selections":
                        foreach (string strTemp in _theEntry.Selections)
                        {
                            this.FieldValue += strTemp;
                            this.FieldValue += ":";
                        }
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.TextEntry)
            {
                UIProcessSchemaObjects.TextEntry _theEntry = (UIProcessSchemaObjects.TextEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "TextValue":
                        this.FieldValue = _theEntry.TextValue;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.UserLoginEntry)
            {
                UIProcessSchemaObjects.UserLoginEntry _theEntry = (UIProcessSchemaObjects.UserLoginEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "UserName":
                        this.FieldValue = _theEntry.UserName;
                        break;
                    case "Password":
                        this.FieldValue = _theEntry.Password;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.YesNoEntry)
            {
                UIProcessSchemaObjects.YesNoEntry _theEntry = (UIProcessSchemaObjects.YesNoEntry)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                    case "Response":
                        this.FieldValue = _theEntry.Response;
                        break;
                }
            }
            else if (_theResource is UIProcessSchemaObjects.TextPrompt)
            {
                UIProcessSchemaObjects.TextPrompt _theEntry = (UIProcessSchemaObjects.TextPrompt)_theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                }
            }
            else
            {
                UIProcessSchemaObjects.FormResource _theEntry = _theResource;
                switch (this.FieldName)
                {
                    default:
                    case "Name":
                        this.FieldValue = _theEntry.Name;
                        break;
                    case "Title":
                        this.FieldValue = _theEntry.Title;
                        break;
                    case "Prompt":
                        this.FieldValue = _theEntry.Prompt;
                        break;
                    case "Completed":
                        this.FieldValue = _theEntry.Completed.ToString();
                        break;
                    case "Required":
                        this.FieldValue = _theEntry.Required.ToString();
                        break;
                }
            }

            return ActivityExecutionStatus.Closed;
        }
    }
}
